﻿using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

// Token: 0x020003AC RID: 940
public class ModalMessage : ModalUI
{
	// Token: 0x0600176A RID: 5994 RVA: 0x0009BEF0 File Offset: 0x0009A0F0
	protected override void Awake()
	{
		base.Awake();
		this.doNotAgainCheck.onValueChanged.AddListener(new UnityAction<bool>(this.ToggleSE));
	}

	// Token: 0x0600176B RID: 5995 RVA: 0x0009BF14 File Offset: 0x0009A114
	private void Update()
	{
	}

	// Token: 0x0600176C RID: 5996 RVA: 0x0009BF18 File Offset: 0x0009A118
	public void Yes()
	{
		bool obj = false;
		if (this.doNotAgainCheck.gameObject.activeSelf)
		{
			obj = this.doNotAgainCheck.isOn;
		}
		if (this.yesSE != null)
		{
			this.GameCtrl.audioCtrl.Play2DSE(this.yesSE);
		}
		if (this.yesAct != null)
		{
			this.yesAct(obj);
		}
		base.End();
	}

	// Token: 0x0600176D RID: 5997 RVA: 0x0009BF8C File Offset: 0x0009A18C
	public void SetUp(string text, Action<bool> yesAct, bool againCheck = false)
	{
		this.text.text = text;
		this.yesAct = yesAct;
		this.doNotAgainCheck.gameObject.SetActive(againCheck);
	}

	// Token: 0x0600176E RID: 5998 RVA: 0x0009BFB4 File Offset: 0x0009A1B4
	private void ToggleSE(bool flag)
	{
		AudioClip audioClip = (!flag) ? this.noSE : this.yesSE;
		if (audioClip != null)
		{
			this.GameCtrl.audioCtrl.Play2DSE(audioClip);
		}
	}

	// Token: 0x04001B17 RID: 6935
	public Canvas myCanvas;

	// Token: 0x04001B18 RID: 6936
	public Text text;

	// Token: 0x04001B19 RID: 6937
	private Action<bool> yesAct;

	// Token: 0x04001B1A RID: 6938
	public AudioClip yesSE;

	// Token: 0x04001B1B RID: 6939
	public AudioClip noSE;

	// Token: 0x04001B1C RID: 6940
	public Toggle doNotAgainCheck;
}
